package com.ruoyi.report.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.report.domain.ReportParam;
import com.ruoyi.report.mapper.ReportParamMapper;
import com.ruoyi.report.service.IReportParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 报告参数Service业务层处理
 * 
 * @author wry
 * @date 2023-06-19
 */
@Service
public class ReportParamServiceImpl implements IReportParamService 
{
    @Autowired
    private ReportParamMapper reportParamMapper;

    /**
     * 查询报告参数
     * 
     * @param paramId 报告参数主键
     * @return 报告参数
     */
    @Override
    public ReportParam selectReportParamByParamId(Long paramId)
    {
        return reportParamMapper.selectReportParamByParamId(paramId);
    }

    /**
     * 查询报告参数列表
     * 
     * @param reportParam 报告参数
     * @return 报告参数
     */
    @Override
    public List<ReportParam> selectReportParamList(ReportParam reportParam)
    {
        return reportParamMapper.selectReportParamList(reportParam);
    }

    /**
     * 新增报告参数
     * 
     * @param reportParam 报告参数
     * @return 结果
     */
    @Override
    public int insertReportParam(ReportParam reportParam)
    {
        reportParam.setCreateTime(DateUtils.getNowDate());
        return reportParamMapper.insertReportParam(reportParam);
    }

    /**
     * 修改报告参数
     * 
     * @param reportParam 报告参数
     * @return 结果
     */
    @Override
    public int updateReportParam(ReportParam reportParam)
    {
        reportParam.setUpdateTime(DateUtils.getNowDate());
        return reportParamMapper.updateReportParam(reportParam);
    }

    /**
     * 批量删除报告参数
     * 
     * @param paramIds 需要删除的报告参数主键
     * @return 结果
     */
    @Override
    public int deleteReportParamByParamIds(Long[] paramIds)
    {
        return reportParamMapper.deleteReportParamByParamIds(paramIds);
    }

    /**
     * 删除报告参数信息
     * 
     * @param paramId 报告参数主键
     * @return 结果
     */
    @Override
    public int deleteReportParamByParamId(Long paramId)
    {
        return reportParamMapper.deleteReportParamByParamId(paramId);
    }
}
